| {% extends "background/base.html" %}
block pagetitle
	| : 内容替换: 替换书籍
- block content
	#NAVID(data-nav="replace")
	.row
		.col-xs-12
			.panel.panel-primary
				.panel-heading 替换书籍
				.panel-body
					form.form-inline(action=".",method="POST")
						| {% csrf_token %}
						- with create_rule_form as CRF
							.form-group(class="{%if CRF.rule_res.errors%}has-error{%endif%}")
								label.sr-only.control-label(for="inputRe")!= CRF.rule_res.label
								input.form-control(style="width:400px;",placeholder="{{CRF.rule_res.label}}",type="text",value="{{CRF.rule_res.value|default:''}}",name="rule_res")
							.form-group(class="{%if CRF.replace_to.errors%}has-error{%endif%}")
								label.sr-only.control-label(for="inputReplace")!= CRF.replace_to.label
								input.form-control(placeholder="{{CRF.replace_to.label}}",type="text",value="{{CRF.replace_to.value|default:''}}",name="replace_to")
							.form-group(class="{%if CRF.book_id.errors%}has-error{%endif%}")
								label.sr-only.control-label(for="inputReplace")!= CRF.book_id.label
								input.form-control(placeholder="{{CRF.book_id.label}}",type="text",value="{{CRF.book_id.value|default:''}}",name="book_id")
							.radio.radio-primary.page-radio(style="display: inline;")
								| {% for radio in CRF.p_or_s %}{{radio}}{% endfor %}
							button.btn.btn-success.btn-sm.btn-raised(type="submit") 提交
		if save
			.col-xs-12
				.alert.alert-warning.text-center
					h2 保存成功!
		if r_content
			.col-xs-12
				.panel.panel-primary
					.panel-heading
						h3.panel-title 预览
					.panel-body
						.row
							.col-xs-12
								.panel.panel-primary
									.panel-body
										!= r_content|safe|linebreaks
